﻿CREATE PROCEDURE [ServiceEngine].[ListSchemaObjectByNameTypeAndNamespace]
@SchemaID UNIQUEIDENTIFIER, @Name NVARCHAR (256), @Type SMALLINT
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
  SELECT 
		SO.[SchemaObjectID],
		SO.[SchemaObjectName],
		SO.[SchemaObjectType],
		SO.[SchemaObjectXml],
		N.EntityName,
		SO.DataEntityID,
		SO.[DateRevised]
  FROM 
		[SchemaObjects] SO JOIN [Names] N ON N.EntityID = SO.SchemaID 
  WHERE
		SO.SchemaID = @SchemaID AND
		SO.[SchemaObjectName] = @Name AND
		SO.[SchemaObjectType] = @Type 
END
